<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">

		<title>发表评论</title>

		<link href="../AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css">
		<link href="../AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css">

		<link href="../css/personal.css" rel="stylesheet" type="text/css">
		<link href="../css/appstyle.css" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
	</head>

	<body>
		<!--头 -->
		<header>
			<article>
				<div class="mt-logo">
					<!--顶部导航条 -->
					<div class="am-container header">
						<ul class="message-l">
							<div class="topMessage">
								<div class="menu-hd">
									<a href="login.html" target="_top" class="h" id="login">亲，请登录</a>
									<a href="register.html" target="_top">免费注册</a>
								</div>
							</div>
						</ul>
						<ul class="message-r">
							<div class="topMessage home">
								<div class="menu-hd"><a href="home2.html" target="_top" class="h">商城首页</a></div>
							</div>
							<div class="topMessage my-shangcheng">
								<div class="menu-hd MyShangcheng"><a href="index.html" target="_top"><i class="am-icon-user am-icon-fw"></i>个人中心</a></div>
							</div>
							<div class="topMessage mini-cart">
								<div class="menu-hd"><a id="mc-menu-hd" href="shopcart.html" target="_top"><i class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong id="J_MiniCartNum" class="h">0</strong></a></div>
							</div>
							<div class="topMessage favorite">
						</ul>
						</div>

						<!--悬浮搜索框-->

						<div class="nav white">
							<div class="logoBig">
								<li><img src="../images/logobig.png" /></li>
							</div>

							<div class="search-bar pr">
								<a name="index_none_header_sysc" href="search.html"></a>
								<form action="search.html">
									<input id="searchInput" name="index_none_header_sysc" type="text" placeholder="搜索" autocomplete="off">
									<input id="ai-topsearch" class="submit am-btn" value="搜索" index="1" type="submit">
								</form>
							</div>
						</div>

						<div class="clear"></div>
					</div>
				</div>
			</article>
		</header>
            <div class="nav-table">
					   <div class="long-title"><span class="all-goods">全部分类</span></div>
					   <div class="nav-cont">
							<ul>
								<li class="index"><a href="home2.html">首页</a></li>
							</ul>
						    <div class="nav-extra">
						    	<i class="am-icon-user-secret am-icon-md nav-user"></i><b></b>我的福利
						    	<i class="am-icon-angle-right" style="padding-left: 10px;"></i>
						    </div>
						</div>
			</div>
			<b class="line"></b>
		<div class="center">
			<div class="col-main">
			<div class="main-wrap">

				<div class="user-comment">
					<!--标题 -->
					<div class="am-cf am-padding">
						<div class="am-fl am-cf">
							<strong class="am-text-danger am-text-lg">发表评论</strong> / <small>Make&nbsp;Comments</small>
						</div>
					</div>
					<hr />
					<!-- 评价 -->
					<div class="comment-main" id="pingjia">
						

					</div>

				</div>

			</div>

			
				<!--底部-->
				<div class="footer">
					<div class="footer-hd">
						<p>
							<a href="#">恒望科技</a>
							<b>|</b>
							<a href="#">商城首页</a>
							<b>|</b>
							<a href="#">支付宝</a>
							<b>|</b>
							<a href="#">物流</a>
						</p>
					</div>
					<div class="footer-bd">
						<p>
							<a href="#">关于恒望</a>
							<a href="#">合作伙伴</a>
							<a href="#">联系我们</a>
							<a href="#">网站地图</a>
							<em>© 2015-2025 Hengwang.com 版权所有. 更多模板 <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> - Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a></em>
						</p>
					</div>
				</div>
			</div>

			<aside class="menu">
				<ul>
					<li class="person active">
						<a href="index.html"><i class="am-icon-user"></i>个人中心</a>
					</li>
					<li class="person">
						<p><i class="am-icon-newspaper-o"></i>个人资料</p>
						<ul>
							<li> <a href="information.html">个人信息</a></li>
							<li> <a href="safety.html">安全设置</a></li>
							<li> <a href="address.html">地址管理</a></li>
							<li> <a href="cardlist.html">快捷支付</a></li>
						</ul>
					</li>
					<li class="person">
						<p><i class="am-icon-balance-scale"></i>我的交易</p>
						<ul>
							<li><a href="order.html">订单管理</a></li>
							<li> <a href="change.html">退款售后</a></li>
							<li> <a href="comment.html">评价商品</a></li>
						</ul>
					</li>
					<li class="person">
						<p><i class="am-icon-dollar"></i>我的资产</p>
						<ul>
							<li> <a href="points.html">我的积分</a></li>
							<li> <a href="coupon.html">优惠券 </a></li>
							<li> <a href="bonus.html">红包</a></li>
							<li> <a href="walletlist.html">账户余额</a></li>
							<li> <a href="bill.html">账单明细</a></li>
						</ul>
					</li>

					<li class="person">
						<p><i class="am-icon-tags"></i>我的收藏</p>
						<ul>
							<li> <a href="collection.html">收藏</a></li>
							<li> <a href="foot.html">足迹</a></li>	
						</ul>
					</li>

					<li class="person">
						<p><i class="am-icon-qq"></i>在线客服</p>
						<ul>
							<li> <a href="consultation.html">商品咨询</a></li>
							<li> <a href="suggest.html">意见反馈</a></li>							
							
							<li> <a href="news.html">我的消息</a></li>
						</ul>
					</li>
				</ul>

			</aside>
		</div>
<script type="text/javascript">
//正则表达式获取url
function GetQueryString(name)
{
     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
     var r = window.location.search.substr(1).match(reg);
     if(r!=null)return  unescape(r[2]); return null;
}

$(function(){
	$(document).ready(function(){
		var order_id= GetQueryString("order_id");
		$.post("../../order_ViewAllById",{order_id:order_id},function(res){
			$("#pingjia").append(`
					<div class="comment-list">
					<div class="item-pic">
						<a href="#" class="J_MakePoint" draggable="false"> <img
							src="../../static/admin/images/${res[0].product_img}" class="itempic" >
						</a>
					</div>

					<div class="item-title">

						<div class="item-name">
							<a href="#">
								<p class="item-basic-info">${res[0].product_name}</p>
							</a>
						</div>
						<div class="item-info">
							<div class="info-little">
								<span>颜色：12#远峰蓝 </span><br/> <span>描述：${res[0].product_content}</span>
							</div>
							<div class="item-price">
								价格：<strong>${res[0].product_price}元</strong>
							</div>
						</div>
					</div>
					<div class="clear"></div>
					<div class="item-comment">
						<textarea placeholder="请写下对宝贝的感受吧，对他人帮助很大哦！" id="pingjia_content"></textarea>
					</div>
					<div class="filePic">
						<input type="file" class="inputPic" id="shaitupian"
							allowexts="gif,jpeg,jpg,png,bmp" accept="image/*"> <span>晒照片</span>
						<img src="../images/image.jpg" alt="">
					</div>
					<div class="item-opinion" id="haoping">
					<label><input type="radio" class="asd" name="haoping" value="好评">好评</label>
					<label><input type="radio" class="asd" name="haoping" value="中评">中评</label>
					<label><input type="radio" class="asd" name="haoping" value="差评">差评</label>
					</div>
				</div>

				<div class="info-btn">
					<div class="am-btn am-btn-danger" id="fabu">发表评论 </div>
				</div>
				
					
					`);
			$(document).ready(function() {
				$(".comment-list .item-opinion li").click(function() {
					$(this).prevAll().children('i').removeClass("active");
					$(this).nextAll().children('i').removeClass("active");
					$(this).children('i').addClass("active");

				});
			})
			$("#fabu").click(function(){
				var pingjia_state=$('input[type="radio"]:checked').val()
			
				$.post("../../pingjiaAdd",{
					pingjia_content:$("#pingjia_content").val(),
					pingjia_state:pingjia_state,
					pingjia_user_id:res[0].user_id,
					pingjia_product_id:res[0].product_id,
					pingjia_img:$("#shaitupian").val(),
					pingjia_order_id:res[0].order_id
				},function(obj){
					if (obj.code=="0") {
						alert("评价成功");
						$.post("../../orderUpdateBy1",{order_spare:5,order_id:res[0].order_id},function(ress){
							if (ress.code=="0") {
								$(location).attr("href","comment.html");
							} else {
								alert("异常");
							}
						},"json");
						
					} else {
						alert("评价失败");
					}
				},"json");
			});
		},"json");
	});
	
})
	


</script>

<script type="text/javascript">

</script>	
	<script type="text/javascript">
		//不锁的页面需要用到的东西
		$(function(){
			if (localStorage.getItem("user_id")!=null) {
				//$("#login").html(localStorage.getItem("user_fullname"));
				document.getElementById('login').innerHTML = localStorage.getItem("user_fullname");
			}
		})
		</script>
		
	</body>

</html>